/**
 * 文件描述如下：
 * 1. 设备驱动页面的数据
 */

const data_1 = {
  title: 'property',
  key: 'property',
  data: [
    {
      id: 0,
      key: 'batch-size',
      parentNode: 'property',
      name: 'batch-size',
      showType: 'input',
      inputType: 'int',
    },
    {
      id: 1,
      key: 'cluster-mode',
      parentNode: 'property',
      name: 'cluster-mode',
      showType: 'input',
      inputType: 'int',
    },
    {
      id: 2,
      key: 'force-implicit-batch-dim',
      parentNode: 'property',
      name: 'force-implicit-batch-dim',
      showType: 'input',
      inputType: 'int',
    },
    {
      id: 3,
      key: 'gie-unique-id',
      parentNode: 'property',
      name: 'gie-unique-id',
      showType: 'input',
      inputType: 'int',
    },
    {
      id: 4,
      key: 'gpu-id',
      parentNode: 'property',
      name: 'gpu-id',
      showType: 'input',
      inputType: 'int',
    },
    {
      id: 5,
      key: 'int8-calib-file',
      parentNode: 'property',
      name: 'int8-calib-file',
      showType: 'input',
      inputType: 'text',
    },
    {
      id: 6,
      key: 'interval',
      parentNode: 'property',
      name: 'interval',
      showType: 'input',
      inputType: 'int',
    },
    {
      id: 7,
      key: 'labelfile-path',
      parentNode: 'property',
      name: 'labelfile-path',
      showType: 'input',
      inputType: 'text',
    },
    {
      id: 8,
      key: 'model-color-format',
      parentNode: 'property',
      name: 'model-color-format',
      showType: 'input',
      inputType: 'int',
    },
    {
      id: 9,
      key: 'model-engine-file',
      parentNode: 'property',
      name: 'model-engine-file',
      showType: 'input',
      inputType: 'text',
    },
    {
      id: 10,
      key: 'model-file',
      parentNode: 'property',
      name: 'model-file',
      showType: 'input',
      inputType: 'text',
    },
    {
      id: 11,
      key: 'net-scale-factor',
      parentNode: 'property',
      name: 'net-scale-factor',
      showType: 'input',
      inputType: 'double',
    },
    {
      id: 12,
      key: 'network-mode',
      parentNode: 'property',
      name: 'network-mode',
      showType: 'input',
      inputType: 'int',
    },
    {
      id: 13,
      key: 'num-detected-classes',
      parentNode: 'property',
      name: 'num-detected-classes',
      showType: 'input',
      inputType: 'int',
    },
    {
      id: 14,
      key: 'output-blob-names',
      parentNode: 'property',
      name: 'output-blob-names',
      showType: 'input',
      inputType: 'text',
    },
    {
      id: 15,
      key: 'process-mode',
      parentNode: 'property',
      name: 'process-mode',
      showType: 'input',
      inputType: 'int',
    },
    {
      id: 16,
      key: 'proto-file',
      parentNode: 'property',
      name: 'proto-file',
      showType: 'input',
      inputType: 'text',
    },
  ],
}

const data_2 = {
  title: 'class-attrs-all',
  key: 'class-attrs-all',
  data: [
    {
      id: 0,
      key: 'nms-iou-threshold',
      parentNode: 'class-attrs-all',
      name: 'nms-iou-threshold',
      showType: 'input',
      inputType: 'double',
    },
    {
      id: 1,
      key: 'pre-cluster-threshold',
      parentNode: 'class-attrs-all',
      name: 'pre-cluster-threshold',
      showType: 'input',
      inputType: 'double',
    },
    {
      id: 2,
      key: 'topk',
      parentNode: 'class-attrs-all',
      name: 'topk',
      showType: 'input',
      inputType: 'int',
    },
  ],
}

export const dataProcessing_deep_pop_2 = (params) => {
  if (!params) return
  // 头部的块
  data_1.data.forEach((item) => {
    item.value = params[item.parentNode][item.key]
  })

  data_2.data.forEach((item) => {
    item.value = params[item.parentNode][item.key]
  })

  return { data_1, data_2 }
}
